package com.nutstudy.ioc.test;


import com.nutstudy.ioc.spring.NutApplicationContext;

/**
 * @author: HyoJoo-W
 * @date: 2021-07-29 09:38
 * @description:
 */


public class Main
{
    public static void main(String[] args)
    {

        NutApplicationContext nutApplicationContext = new NutApplicationContext(AppConfig.class);

//        UserService userService = (UserService) nutApplicationContext.getBean("userService");
//
//        System.out.println("userService = " + userService);
//        System.out.println(nutApplicationContext.getBean("userService"));
//        System.out.println(nutApplicationContext.getBean("userService"));
//        System.out.println(nutApplicationContext.getBean("userService"));

        //JDK代理生成的代理对象类型是接口类型
        UserInterface userService = (UserInterface) nutApplicationContext.getBean("userService");
        userService.test();
    }
}
